
<table cellpadding="2" cellspacing="1" id="<?php echo $fieldid;?>-radio-table">
<?php
$param['options'] = isset($param['options']) ? $param['options'] : [['key'=> '', 'value'=>'']];
if ($param['options']) foreach($param['options'] as $k=>$v){?>
	<tr index="<?php echo $k?>"> 
      <td width="70" align="right">KEY：</td>
      <td width="110"><textarea name="Field[param][options][<?php echo $k?>][key]" id="options" class="textarea-text" style="height:20px;width:80px;resize:none; margin:5px 0"><?php echo $v['key']?></textarea></td>
      <td width="230">VALUE：<textarea name="Field[param][options][<?php echo $k?>][value]" id="options" class="textarea-text" style="height:20px;width:150px;resize:none;"><?php echo $v['value']?></textarea></td>
      <td align="left"><a href="javascript:;" style="color:rgba(0,102,255,1)" class="addoptions">添加</a> <a href="javascript:;" style="color:rgba(0,102,255,1)" class="deloptions<?php echo $k==0 ? ' hidden' : ''?>">删除</a></td>
    </tr>
<?php
}
?>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--


$(function(){
	$('.addoptions').live('click',function(){
		var index = parseInt($('#<?php echo $fieldid;?>-radio-table tr:last').attr('index')) + 1;
		var tr = $('#<?php echo $fieldid;?>-radio-table tr:first').clone();
		//alert(index)
		tr.attr('index', index);
		tr.find('textarea:first').attr('name', 'Field[param][options]['+index+'][key]').val('');
		tr.find('textarea:last').attr('name', 'Field[param][options]['+index+'][value]').val('');
		tr.find('.deloptions').removeClass('hidden');
		tr.appendTo($('#<?php echo $fieldid;?>-radio-table'));
	});
	$('.deloptions').live('click',function(){
		if($('#<?php echo $fieldid;?>-radio-table tr').length >1){
			$(this).parent().parent().remove();
		}
	});
});
//-->
</SCRIPT>